Skip to content

ci: borrow issue-lifecycle scripts from anthropics/claude-code#51

Merged
lukeocodes merged 1 commit intomainfrom
ci/borrow-issue-lifecycle-scripts
May 2, 2026
Merged

ci: borrow issue-lifecycle scripts from anthropics/claude-code#51
lukeocodes merged 1 commit intomainfrom
ci/borrow-issue-lifecycle-scripts

Conversation

@lukeocodes
Copy link
Copy Markdown
Member

Summary

Four workflows in this repo (`sweep.yml`, `auto-close-duplicates.yml`, `backfill-duplicate-comments.yml`, `issue-lifecycle-comment.yml`) were copied from anthropics/claude-code but without their backing scripts. The workflows have been silently failing on every run with `error: Module not found './scripts/.ts'` (or the bun equivalent).

This PR adds the missing scripts.

What lands

File Source Localization
`scripts/sweep.ts` upstream `NEW_ISSUE` points at `deepgram/cli/issues/new/choose`
`scripts/auto-close-duplicates.ts` upstream Default owner/repo fall back to `deepgram/cli`; removed "Generated with Claude Code" attribution from the auto-close comment (it's a workflow, not a model-generated message)
`scripts/backfill-duplicate-comments.ts` upstream Real fix: replaced hardcoded `owner='anthropics' / repo='claude-code'` with parsing from `GITHUB_REPOSITORY` env var (auto-set by Actions). Upstream was implicitly assuming the script only ever runs in their repo.
`scripts/lifecycle-comment.ts` upstream Verbatim
`scripts/issue-lifecycle.ts` (helper) upstream "Claude Code" → "Deepgram CLI"; support URL repointed to `developers.deepgram.com`; `claude --version` → `dg --version`
`scripts/gh.sh` (helper) upstream Error message example updated to `deepgram/cli`

Workflow drift check (per the CTO's request)

All four workflow YAMLs in `.github/workflows/` are byte-identical to their upstream counterparts except for intentional security hardening — actions are pinned to specific commit SHAs (`actions/checkout@34e1148... # v4`) instead of version tags. No other drift, no other changes needed in the workflow YAMLs themselves as part of this PR.

Workflow Drift
`sweep.yml` SHA pinning only
`auto-close-duplicates.yml` SHA pinning only
`backfill-duplicate-comments.yml` SHA pinning only
`issue-lifecycle-comment.yml` SHA pinning only

Verification

  • `bun build --target=bun` compiles all 5 `.ts` files cleanly (no type errors, no syntax errors)
  • `bash -n scripts/gh.sh` passes
  • `gh.sh` marked executable (`mode 100755`)
  • Imports resolve correctly: `sweep.ts` and `lifecycle-comment.ts` import from `./issue-lifecycle.ts` ✓

Things to call out

  1. Labels expected by the scripts — these scripts read/write the labels `invalid`, `needs-repro`, `needs-info`, `stale`, `autoclose`, and `duplicate`. If any are missing from this repo, the corresponding code path silently no-ops (GitHub API accepts unknown labels in queries, returns no matches). The existing `claude-issue-triage.yml` and `claude-dedupe-issues.yml` workflows in this repo presumably already use them, but worth verifying once on a real triage run.

  2. `STATSIG_API_KEY` env var in `auto-close-duplicates.yml` — present in both the local workflow and upstream, but the script doesn't actually read it. Inherited claude-code-internal noise. I left the workflow untouched since you asked for a drift check, not a workflow refactor; happy to drop the line in a follow-up if you want.

  3. Provenance comments — `scripts/issue-lifecycle.ts` carries a 3-line header noting it was borrowed from `anthropics/claude-code`. Other scripts inherit upstream's existing comments verbatim. Strategy: minimize divergence so future re-borrows are easy diffs.

Unrelated to the homebrew work

This PR is independent of:

Those can merge in any order, and this scripts PR is gated only on its own review.

Four workflows were copied from anthropics/claude-code without their
backing scripts, so they have been failing on every run since they
landed:

  - sweep.yml                      -> scripts/sweep.ts
  - auto-close-duplicates.yml      -> scripts/auto-close-duplicates.ts
  - backfill-duplicate-comments.yml -> scripts/backfill-duplicate-comments.ts
  - issue-lifecycle-comment.yml    -> scripts/lifecycle-comment.ts

This PR adds the missing scripts plus their two helpers
(issue-lifecycle.ts, gh.sh) borrowed verbatim from
github.com/anthropics/claude-code/tree/main/scripts and adapted for
this repo where appropriate.

Localizations applied:

  - issue-lifecycle.ts: 'Claude Code' -> 'Deepgram CLI'; support URL
    repointed to developers.deepgram.com; 'claude --version' replaced
    by 'dg --version' in the needs-info nudge.

  - sweep.ts: NEW_ISSUE points at deepgram/cli/issues/new/choose
    (everything else verbatim).

  - auto-close-duplicates.ts: default owner/repo fall back to
    deepgram/cli when GITHUB_REPOSITORY_OWNER/_NAME are missing
    (claude-code's defaults). Removed the 'Generated with Claude Code'
    attribution from the auto-close comment since this is a workflow,
    not a model-generated message.

  - backfill-duplicate-comments.ts: replaced the upstream's hardcoded
    owner='anthropics' / repo='claude-code' with parsing from the
    GITHUB_REPOSITORY env var (auto-set by GitHub Actions). This is a
    real fix for re-use; upstream was implicitly assuming the script
    only ever runs in claude-code.

  - gh.sh: error message example updated to reference deepgram/cli.

Workflow drift check (per the CTO's request):

  All four workflow YAMLs are byte-identical to upstream EXCEPT for
  intentional security hardening — actions are pinned to specific
  commit SHAs (e.g. actions/checkout@34e1148... # v4) instead of
  version tags. No other drift. Workflows themselves do not need to
  change as part of this PR.

Verification:

  - 'bun build --target=bun' compiles all 5 .ts files cleanly
  - 'bash -n scripts/gh.sh' passes
  - gh.sh marked +x

Note: this is unrelated to the open homebrew-tap/cli rust-fix PRs,
which can merge independently of this.
@lukeocodes lukeocodes merged commit 80049f2 into main May 2, 2026
38 checks passed
@lukeocodes lukeocodes deleted the ci/borrow-issue-lifecycle-scripts branch May 2, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant